package com.oig.sys.msg.dao;

import com.oig.sys.msg.entity.TbMqConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
@author wuxl
*/
public interface ITbMqConfigDao extends JpaRepository<TbMqConfig, Integer> {

	@Query("from TbMqConfig c where c.id=:id")
	TbMqConfig getMqConfigById(@Param("id")Integer id);


	@Query("select c from TbMqConfig c where c.systemId=:systemId and c.businessType=:businessType and c.relationType=:relationType and c.status='04' ")
	TbMqConfig getOkMqConfig(@Param("systemId") Integer systemId, @Param("businessType") String businessType, @Param("relationType") String relationType);

	@Query("select c from TbMqConfig c where c.systemId=:systemId and c.relationType=:relationType and c.status='04' ")
	TbMqConfig getOkMqConfig(@Param("systemId") Integer systemId, @Param("relationType") String relationType);

	@Query("select c from TbMqConfig c where c.relationType=:relationType and c.status='04' ")
	TbMqConfig getOkMqConfig(@Param("relationType") String relationType);
}
